9 turtle(int W
, int S
) : w(W
), s(S
) {}
10 bool operator < (const turtle
&y
) const{
11 return (s
- w
< y
.s
- y
.w
) ||
12 (s
- w
== y
.s
- y
.w
&& w
< y
.w
) ||
13 (s
- w
== y
.s
- y
.w
&& w
== y
.w
&& y
.s
< y
.w
);
20 while (cin
>> x
>> y
){
21 t
.push_back(turtle(x
,y
));
23 sort(t
.begin(), t
.end());
25 /*for (int i=0; i<t.size(); ++i){
26 cout << "turtle[i]: " << t[i].w << " " << t[i].s;
30 vector
<int> p(t
.size()), a(t
.size());
31 for (int i
=0; i
<t
.size(); ++i
){
34 for (int j
=0; j
<i
; ++j
){
35 if (t
[i
].w
+ p
[j
] <= t
[i
].s
&& a
[i
] < a
[j
] + 1){
41 cout
<< *(max_element(a
.begin(), a
.end())) << endl
;